unit AbreCaixa;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, PadraoCadastro, ImgList, ComCtrls, ToolWin, StdCtrls, Buttons,
  FMTBcd, DB, SqlExpr;

type
  TFormAbreCaixa = class(TFormPadraoCadastro)
    Label4: TLabel;
    EditValor: TEdit;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    SQLStoredProcAbreCaixa: TSQLStoredProc;
    procedure EditValorExit(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormAbreCaixa: TFormAbreCaixa;

implementation

uses principal;

{$R *.dfm}

procedure TFormAbreCaixa.BitBtn1Click(Sender: TObject);
begin
  inherited;
  if MessageDlg('Deseja Abrir o Caixa  ? ', mtConfirmation, [mbYes, mbNo], 0) = mrYes then
  begin

    SQLStoredProcAbreCaixa.ParamByName('p_valor').AsString := EditValor.Text;

    Try
      SQLStoredProcAbreCaixa.ExecProc;
    Finally

      MessageDlg('Caixa Aberto',mtWarning , [mbOK],0);
      self.Close;
    End;

  end;
end;

procedure TFormAbreCaixa.BitBtn2Click(Sender: TObject);
begin
  inherited;
   self.Close;
end;

procedure TFormAbreCaixa.EditValorExit(Sender: TObject);
begin
  inherited;
  EditValor.Text := FormPrincipal.FormataPreco(EditValor.Text);
end;

end.
